Skip to main content

mysql 5.6 163源

拉取网易蜂巢的mysql-server:5.6

docker pull hub.c.163.com/nce2/mysql:5.6

创建mysql5.6容器 1master+3个slave

docker run --name mysql-master -d -P hub.c.163.com/nce2/mysql:5.6 docker run --name mysql-slave1 -d -P hub.c.163.com/nce2/mysql:5.6 docker run --name mysql-slave2 -d -P hub.c.163.com/nce2/mysql:5.6 docker run --name mysql-slave3 -d -P hub.c.163.com/nce2/mysql:5.6

查看容器状态

docker ps

通过主机命令行进入master容器

docker exec -it mysql-master bash

登录到slave1容器

docker exec -it mysql-slave1 bash

master的服务器mysql账号root赋值权限

grant all privileges on . to root@'%' identified by ''; flush privileges;